import java.util.Scanner;

public class java7 {
    public static void main(String[] args) {

            Scanner scanner = new Scanner(System.in);

            String input = scanner.nextLine();
            String a = scanner.nextLine();

            StringBuilder inputBuilder = new StringBuilder(input);
            boolean found = true;

            for (char c : a.toCharArray()) {
                int i = inputBuilder.indexOf(String.valueOf(c));
                if (i != -1) {
                    inputBuilder.deleteCharAt(i);
                } else {
                    found = false;
                    break;
                }
            }

            if (found) {
                System.out.println("Yes " + inputBuilder.toString());
            } else {
                System.out.println("No");
            }
        }
}
